package com.crm.model.jdao;

import java.util.List;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;

import com.crm.model.pojo.SalesOpportunity;
import com.crm.model.pojo.ShowsettingSalesOpportunity;

/**
 * 销售机会JPA的dao
 * @author 飞鱼
 *
 */
public interface ISalesOpportunityDAO extends CrudRepository<SalesOpportunity,Integer> {

	/**
	 * 带条件的分页，查询所有销售机会
	 * @param <T>
	 * @return
	 * 
	 */
 
 Page<SalesOpportunity> findAll(Specification<SalesOpportunity> spec,Pageable pageable);
  
  /**
   * 统计对象个数
   */
  long count();
  
  /**
   * 根据id查询销售机会
   * @param salId
   * @return
   */
  SalesOpportunity findBySalId(Integer salId);
  
  /**
   * 确认销售机会是否重复
   * @param salThme
   * @return
   */
  SalesOpportunity findBySalTheme(String salTheme);

  


}
